package com.sky.controller.user;


import com.sky.entity.Category;
import com.sky.result.PageBean;
import com.sky.result.Result;
import com.sky.service.CategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@RestController("userCategoryController")
@RequestMapping("/user/category")
public class CategoryController {
    @Autowired
    CategoryService categoryService;

    // 根据分类查询
    @GetMapping("/list")
    public Result listCategory(String type) {
        List<Category> listCategory = categoryService.listCategory(type);
        return Result.success(listCategory);
    }


}
